home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr57 / nwnt.zip / NWNT.EXE / OEMNADNT.INF < prev    next >
INI File  |  1993-04-22  |  31KB  |  1,083 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADNT.INF
  4. ;
  5. ;       Novell ODI IBM Token Ring network card SETUP INF file.
  6. ;
  7. ;***********************************************************************
  8.  
  9. ;-----------------------------------------------------------------------
  10. ; OPTION TYPE
  11. ; -----------
  12. ; This identifies the Option type we are dealing with.  The different
  13. ; possible types are:
  14. ;
  15. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  16. ;
  17. ;  Types specific to networking:
  18. ;
  19. ; NetAdapter,        a netcard / adapter combination or just a netcard
  20. ; NetDriver,         just a netcard driver
  21. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  22. ; NetService,        an NT networking service
  23. ; NetWork,           a complete network ensemble.
  24. ; NetProvider        a complete network which supports NT MPR protocol
  25. ;-----------------------------------------------------------------------
  26.  
  27. [Identification]
  28.     OptionType = NetAdapter
  29.  
  30. ;-----------------------------------------------------------------------
  31. ; PlatformsSupported
  32. ; ------------------
  33. ; This identifies the platforms supported by the adapter card.
  34. ; Possible types are:
  35. ;
  36. ; ISA, EISA and MCA
  37. ;-----------------------------------------------------------------------
  38.  
  39. [PlatformsSupported]
  40.     ISA
  41.     EISA
  42.     MCA
  43.     "Jazz-Internal Bus"
  44.  
  45. ;-----------------------------------------------------------------------
  46. ; OPTION LIST
  47. ; -----------
  48. ; This section lists the OEM Option key names.  These keys are locale
  49. ; independent and used to represent the option in a locale independent
  50. ; manner.
  51. ;
  52. ;-----------------------------------------------------------------------
  53.  
  54. [Options]
  55.     ODI_IBMTOK
  56.  
  57. [LanguagesSupported]
  58.     ENG
  59.  
  60. [OptionsTextENG]
  61.     ODI_IBMTOK     = "ODI IBM Token Ring Adapter"
  62.  
  63. ;***********************************************************************
  64. ; CONSTANTS
  65. ;***********************************************************************
  66. [GeneralConstants]
  67. ;
  68. ;  Program flow control variables.
  69. ;
  70. from      = ""
  71. to        = ""
  72. retaddr   = ""
  73. KeyNull         = ""
  74. StringNull      = ""
  75. MAXIMUM_ALLOWED   = 33554432
  76. RegistryErrorIndex = NO_ERROR
  77. KeyProduct      = ""
  78. KeyParameters   = ""
  79. TRUE            = 1
  80. FALSE           = 0
  81. NoTitle            = 0
  82. ExitState   = "Active"
  83. OldVersionExisted = $(FALSE)
  84. DriverPath      = $(!STF_NTPATH)\drivers
  85.  
  86. ;***********************************************************************
  87. ; CONSTANTS
  88. ;***********************************************************************
  89. [FileConstants]
  90. ;
  91. ;  File names, etc.
  92. ;
  93. UtilityInf      = "UTILITY.INF"
  94. ParamInf        = "NCPARAM.INF"
  95. subroutineinf   = "SUBROUTN.INF"
  96. SoftwareType    = "driver"
  97.  
  98. ;
  99. ; EventLog Message File
  100. ;
  101. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  102. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  103.  
  104. ; Product Info
  105. ;
  106. Manufacturer    = "Novell"
  107. ProductMajorVersion     = "0"
  108. ProductMinorVersion     = "9"
  109. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  110. ;
  111. ; Hardware
  112. ;
  113. DriverName                   = "ODILOAD"
  114. OdiModules                   = "ODI_Modules"
  115. ProductHardwareName          = "Token"
  116. ProductHardwareTitle         = "ODI IBM Token Ring Adapter"
  117. NetRuleHardwareType          = "nwibmtok nwAdapter"
  118. NetRuleHardwareBindForm      = " yes yes container"
  119. ;
  120. ; Registry Key
  121. ;
  122. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(DriverName)"\CurrentVersion"
  123. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  124.  
  125. ;
  126. ;  Dialog Parameters
  127. ;
  128. IOBaseAddrHexList = ^(IOBaseAddrChoices, 1)
  129. IOBaseAddrDecList = ^(IOBaseAddrChoices, 2)
  130. IOBaseAddrNwList  = ^(IOBaseAddrChoices, 3)
  131.  
  132. [IOBaseAddrChoices]
  133. IOBase_1  = "0xA20",2592,A20
  134. IOBase_2  = "0xA24",2596,A24
  135.  
  136. [FileConstantsENG]
  137. ProCaption   = "Netware for Windows NT Setup"
  138. ProCancel    = "Cancel"
  139. ProCancelMsg = "Netware for Windows NT is not correctly installed.  "+
  140.                "Are you sure you want to cancel copying files?"
  141. ProCancelCap = "Network Setup Message"
  142. ProText1     = "Copying:"
  143. ProText2     = "To:"
  144. FunctionTitle   = "ODI IBM Token Ring Adapter Card Setup"
  145. ProductSoftwareDescription      = "ODI IBM Token Ring Adapter Driver"
  146. ProductHardwareDescription      = "ODI IBM Token Ring Adapter"
  147.  
  148. [DialogConstantsENG]
  149. Help        = "&Help"
  150. Exit        = "Cancel"
  151. OK          = "OK"
  152. HelpContext = ""
  153. Continue    = "Continue"
  154. Cancel      = "Cancel"
  155. [date]
  156.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  157. [FileDependentDlgENG]
  158. DlgType = "Radio"
  159. DlgTemplate = "IBM_TOKEN"
  160. Caption = $(FunctionTitle)
  161. Group1 = "I/O Port Base Address"
  162. Radio1 = "&Primary"
  163. Radio2 = "&Secondary"
  164. OptionsGreyed = {}
  165. HelpContext = $(!IDH_DB_OEMNADTK_INS)
  166. ;---------------------------------------------------------------------------
  167. ; 1. Identify
  168. ;
  169. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  170. ;                as we are choosing currently.
  171. ;
  172. ; INPUT:         None
  173. ;
  174. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  175. ;                $($R1): Option Type (COMPUTER ...)
  176. ;                $($R2): Diskette description
  177. ;---------------------------------------------------------------------------
  178.  
  179. [Identify]
  180.     ;
  181.     ;
  182.     read-syms Identification
  183.  
  184.     set Status     = STATUS_SUCCESSFUL
  185.     set Identifier = $(OptionType)
  186.     set Media      = #("Source Media Descriptions", 1, 1)
  187.  
  188.     Return $(Status) $(Identifier) $(Media)
  189.  
  190. ;------------------------------------------------------------------------
  191. ; 2. ReturnOptions:
  192. ;
  193. ; DESCRIPTION:   To return the option list supported by this INF and the
  194. ;                localised text list representing the options.
  195. ;
  196. ;
  197. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  198. ;
  199. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  200. ;                                STATUS_NOLANGUAGE
  201. ;                                STATUS_FAILED
  202. ;                                STATUS_NOTSUPPORTED
  203. ;
  204. ;                $($R1): Option List
  205. ;                $($R2): Option Text List
  206. ;------------------------------------------------------------------------
  207.  
  208. [ReturnOptions]
  209.     ;
  210.     ;
  211.     set Status        = STATUS_FAILED
  212.     set OptionList     = {}
  213.     set OptionTextList = {}
  214.  
  215.     ;
  216.     ; Check if the language requested is supported
  217.     ;
  218.     set LanguageList = ^(LanguagesSupported, 1)
  219.     Ifcontains(i) $($0) in $(LanguageList)
  220.         ;
  221.         ; Check if the platforms requested is supported
  222.         ;
  223.         ifstr(i) $($1) == ""
  224.            goto returnoptions
  225.         endif
  226.  
  227.         set PlatformList = ^(PlatformsSupported, 1)
  228.         Ifcontains(i) $($1) in $(PlatformList)
  229.            goto returnoptions
  230.         else
  231.            set Status = STATUS_NOTSUPPORTED
  232.            goto finish_ReturnOptions
  233.         endif
  234.     else
  235.         set Status = STATUS_NOLANGUAGE
  236.         goto finish_ReturnOptions
  237.     endif
  238.  
  239.     ;
  240.     ; form a list of all the options and another of the text representing
  241.     ;
  242.  
  243. returnoptions = +
  244.     set OptionList     = ^(Options, 1)
  245.     set OptionTextList = ^(OptionsText$($0), 1)
  246.     set Status         = STATUS_SUCCESSFUL
  247.  
  248. finish_ReturnOptions = +
  249.     Return $(Status) $(OptionList) $(OptionTextList)
  250.  
  251. ;----------InstallOption-------------------------------------------------
  252. ;
  253. ; InstallOption:
  254. ;
  255. ;      This section is shelled to by main installation processing
  256. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  257. ;
  258. ;
  259. ; FUNCTION:  To copy files representing Options
  260. ;            To configure the installed option
  261. ;            To update the registry for the installed option
  262. ;
  263. ; INPUT:     $($0):  Language to use
  264. ;            $($1):  OptionID to install
  265. ;            $($2):  SourceDirectory
  266. ;            $($3):  AddCopy  (YES | NO)
  267. ;            $($4):  DoCopy   (YES | NO)
  268. ;            $($5):  DoConfig (YES | NO)
  269. ;
  270. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  271. ;                            STATUS_NOLANGUAGE |
  272. ;                            STATUS_USERCANCEL |
  273. ;                            STATUS_FAILED
  274. ;
  275. ;------------------------------------------------------------------------
  276. [InstallOption]
  277.     ;
  278.     ; extract parameters
  279.     ;
  280.     set Option   = $($1)
  281.     set SrcDir   = $($2)
  282.     set AddCopy  = $($3)
  283.     set DoCopy   = $($4)
  284.     set DoConfig = $($5)
  285.  
  286.     ;
  287.     ; Check if the language requested is supported
  288.     ;
  289.     set LanguageList = ^(LanguagesSupported, 1)
  290.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  291.         Return STATUS_NOLANGUAGE
  292.     endif
  293.     Debug-Output "OEMNADTK.INF: STF_CWDIR is: "$(!STF_CWDIR)
  294.  
  295.     ; define all the constants
  296.  
  297.     set-subst LF = "\n"
  298.  
  299.     read-syms GeneralConstants
  300.     read-syms FileConstants
  301.  
  302.     read-syms DialogConstants$(!STF_LANGUAGE)
  303.     ifstr(i) $(!NTN_Origination) == "NCPA"
  304.         set Continue = "OK"
  305.     endif
  306.     read-syms FileConstants$(!STF_LANGUAGE)
  307.  
  308.     detect date
  309.  
  310.     set-title  $(FunctionTitle)
  311.  
  312.     set to   = Begin
  313.     set from = Begin
  314. ;
  315. ;  Assume all is well.
  316. ;
  317.     set CommonStatus = STATUS_SUCCESSFUL
  318.  
  319.     EndWait
  320.  
  321. ;
  322. ;   Set up the operation-mode-based variables and gaily welcome
  323. ;   the user.  If the "install mode" variable is improperly set,
  324. ;   assume this is a new installation.
  325. ;
  326.  
  327. Begin = +
  328.  
  329.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  330.                 set StartLabel = removeadapter
  331.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  332.                 set StartLabel = UpgradeSoftware
  333.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  334.                 set StartLabel = bindingadapter
  335.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  336.                 set StartLabel = configureadapter
  337.     else
  338.                 set StartLabel = installadapter
  339.                 set OEM_ABANDON_OPTIONS = {}
  340.                 set OEM_ABANDON_SOFTWARE = FALSE
  341.                 set OEM_ABANDON_ON = TRUE
  342.     endif
  343.  
  344.  
  345.     Set TypeList = {{IOADDR, IOADDR_Addr_List, IOBaseAddress}}
  346.  
  347.  
  348.     set from = $(fatal)
  349.     set to = $(fatal)
  350.     goto $(StartLabel)
  351.  
  352. ;-----------------------------------------------
  353. ; Installation Section
  354. ;-----------------------------------------------
  355.  
  356. installadapter = +
  357.  
  358.     goto adapteroptions
  359.  
  360.  
  361. ;-----------------------------------------------
  362. ; Configuration Section
  363. ;-----------------------------------------------
  364. ;
  365. ;   Get the current values of all the parameters
  366. ;
  367. configureadapter = +
  368.     Ifstr $(KeyProduct) == $(KeyNull)
  369.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  370.         Ifstr $(KeyProduct) == $(KeyNull)
  371.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  372.             Debug-Output "Cannot find component product key"
  373.             goto fatalregistry
  374.         Endif
  375.     Endif
  376.  
  377.     Set AdapterNumber = ""
  378.  
  379.     ;
  380.     ; Get the other parameters;  they're attached to the service parameters key
  381.     ;
  382.     Debug-Output "OEMNADNT.INF: Shelling to FindService"
  383.     Shell $(UtilityInf) FindService, $(KeyProduct)
  384.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  385.         Debug-Output "OEMNADNT.INF: FindService shell failure"
  386.         Goto ShellCodeError
  387.     Endif
  388.     Ifstr(i) $($R0) != NO_ERROR
  389.         Debug-Output "OEMNADNT.INF: FindService Shell error: "$($R0)
  390.         Goto fatalregistry
  391.     endif
  392.  
  393.     set KeyParameters = $($R2)
  394.  
  395.     ;
  396.     ;  We don't need the services key, so close it.
  397.     ;
  398.     CloseRegKey $($R1)
  399.  
  400.     Ifstr $(KeyParameters) == $(KeyNull)
  401.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  402.         Debug-Output "Cannot find component service"
  403.         goto fatalregistry
  404.     endif
  405.  
  406.     set OldVersionExisted = $(TRUE)
  407.  
  408.     set ValueName = ""
  409.     set ValueData = ""
  410.     set ValueStr  = ""
  411.     set ValueList = {}
  412.  
  413.     ;
  414.     ; Get the old values
  415.     ;
  416.     EnumRegValue $(KeyParameters) ValueList
  417.  
  418.     ForListDo $(ValueList)
  419.  
  420.         set ValueItem = $($)
  421.         set ValueName = *($(ValueItem),1)
  422.         set ValueData = *($(ValueItem),4)
  423.         Ifstr(i) $(ValueName) == "IOBaseAddress"
  424.            set IOBaseAddress = $(ValueData)
  425.         endif
  426.  
  427.  
  428.  
  429.     EndForListDo
  430.  
  431.     ifstr(i) $(IOBaseAddress) == ""
  432.         set IOBaseAddress = 1
  433.     endif
  434.  
  435.  
  436.  
  437.  
  438. ;
  439. ;  Read the symbolic link to the ODI entry from the "OdiLoadName" value
  440. ;
  441.     GetRegValue $(KeyParameters),"OdiLoadName", CardInstanceList
  442.     Set CardInstanceName = *($(CardInstanceList),4)
  443.  
  444. adaptersetup =+
  445.  
  446.     goto adapteroptions
  447. ;
  448. ;   Let the user bang on the options until satisfied.
  449. ;
  450. adapteroptions = +
  451.     set from = adapteroptions
  452.  
  453.     set RadioDefault = $(IOBaseAddress)
  454.  
  455.  
  456.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  457.  
  458.     ui start "InputDlg"
  459.  
  460.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  461.         set IOBaseAddress = $(ButtonChecked)
  462.  
  463.         ui pop 1
  464.     else-ifstr(i) $(DLGEVENT) == "BACK"
  465.         set CommonStatus = STATUS_USERCANCEL
  466.         Debug-Output "Action: exit. Bye."
  467.         ui pop 1
  468.         goto end
  469.     else
  470.         ;
  471.         ; Unknow command
  472.         ;
  473.         ui pop 1
  474.         Debug-Output "Action: unknown. Bye."
  475.         goto end
  476.     endif
  477.  
  478.  
  479.  
  480. ;
  481. ;   If installing, go create the necessary keys;
  482. ;   if configuring, they're already open.
  483. ;
  484.     ifint $(OldVersionExisted) == $(TRUE)
  485.         ifstr(i) $(!NTN_InstallMode) == configure
  486.             goto writeparameters
  487.         endif
  488.     endif
  489.  
  490.     StartWait
  491. ;
  492. ;   Create the HARDWARE\Netcard region and its corresponding service
  493. ;
  494.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  495.  
  496.     ifint $($R4) != -1
  497.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  498.     endif
  499.  
  500.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  501.         Debug-Output "Cannot add hardware component"
  502.         goto ShellCodeError
  503.     endif
  504.  
  505.     set RegistryErrorIndex = $($R0)
  506.  
  507.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  508.         EndWait
  509.         Debug-Output "Registry error: add hardware component"
  510.         CloseRegKey $($R1)
  511.         CloseRegKey $($R2)
  512.         CloseRegKey $($R3)
  513.         goto fatalregistry
  514.     endif
  515.  
  516. ;
  517. ;   At this point:
  518. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  519. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  520. ;     $R3  Registry key handle for <service>\Parameters key
  521. ;     $R4  Adapter number assigned to adapter
  522. ;     $R5  Service name generated by combining svc name with adapter number
  523. ;
  524.     set KeyParameters = $($R3)
  525.     set KeyAdapterRules = $($R2)
  526.     set AdapterNumber = $($R4)
  527.  
  528.     Set-add TempAdapterNumber = $(AdapterNumber),0
  529.  
  530.     set CardInstanceName = $(ProductHardwareName)" #"$(TempAdapterNumber)
  531.  
  532.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  533.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  534.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  535.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  536.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  537.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  538.  
  539.     Debug-Output "AddValueList: $R1 = "$($R1)
  540.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  541.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  542.         Debug-Output "ShellCode error"
  543.         goto ShellCodeError
  544.     endif
  545.  
  546.     CloseRegKey $($R1)
  547.  
  548.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  549.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  550.  
  551.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  552.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  553.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  554.  
  555.     Debug-Output "AddValueList: KeyAdapterRules = "$(KeyAdapterRules)
  556.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  557.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  558.         Debug-Output "ShellCode error."
  559.         goto ShellCodeError
  560.     endif
  561.  
  562.     set RegistryErrorIndex = $($R0)
  563.  
  564.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  565.         EndWait
  566.         Debug-Output "Resgitry error: add value list."
  567.         CloseRegKey $(KeyParameters)
  568.         CloseRegKey $(KeyAdapterRules)
  569.         goto fatalregistry
  570.     endif
  571.  
  572.     CloseRegKey $(KeyAdapterRules)
  573.  
  574.     SetRegValue $(KeyParameters) {OdiLoadName,$(NoTitle),$(!REG_VT_SZ),$(CardInstanceName)}
  575.  
  576.     goto writeparameters
  577. ;
  578. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  579. ;
  580. writeparameters = +
  581.     Shell $(UtilityInf), GetBusTypeNum
  582.     set BusTypeNum = $($R1)
  583.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  584.         Debug-Output "ShellCode error."
  585.         goto ShellCodeError
  586.     endif
  587. ;
  588. ;   Add the rest of the parameters to the Services area
  589. ;
  590.     set NewValueList = {{IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddress)},+
  591.                        {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  592.                        {MediaType,$(NoTitle),$(!REG_VT_DWORD),2},+
  593.                        {MaximumPacketSize,$(NoTitle),$(!REG_VT_DWORD),8192}}
  594.  
  595.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  596.  
  597.     CloseRegKey $(KeyParameters)
  598.  
  599.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  600.         Debug-Output "ShellCode error."
  601.         goto ShellCodeError
  602.     endif
  603.  
  604.     set RegistryErrorIndex = $($R0)
  605.  
  606.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  607.         Debug-Output "Registry error: Add value list"
  608.         goto fatalregistry
  609.     endif
  610.  
  611. ;
  612. ; Check for IbmTok service, If found change start to 4 so it is not loaded
  613. ;
  614.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName) $(MAXIMUM_ALLOWED) KeyNE2000
  615.     Ifstr(i) $(KeyNE2000) != $(KeyNull)
  616.         SetRegValue $(KeyNE2000) {Start,$(NoTitle),$(!REG_VT_DWORD),4}
  617.     Endif
  618.  
  619.     EndWait
  620.  
  621. ;
  622. ;  TRAVIS: Put the ODILOAD update info here!
  623. ;
  624.     Debug-Output "Add ODILOAD Parameters"
  625.  
  626.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\OdiLoad" $(MAXIMUM_ALLOWED) KeyOdiLoad
  627.     Ifstr $(KeyOdiLoad) == $(KeyNull)
  628.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  629.         Debug-Output "Cannot find OdiLoad "
  630.         goto fatalregistry
  631.     Endif
  632.  
  633.     Set KeyOdiCard = $(KeyNull)
  634.     Debug-Output "CardInstanceName = "$(CardInstanceName)
  635.  
  636.     set CloseOdiModules = ""
  637.  
  638.     Ifstr(i) $(AdapterNumber) != ""
  639.         ;  This adapter was just installed; allow creation of the #nn key
  640.     CreateRegKey $(KeyOdiLoad) {$(OdiModules),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyOdiModules
  641.     Ifstr(i) $(KeyOdiModules) == $(KeyNull)
  642.         OpenRegKey $(KeyOdiLoad) "" $(OdiModules) $(MAXIMUM_ALLOWED) KeyOdiModules
  643.         Ifstr(i) $(KeyOdiLoad) == $(KeyNull)
  644.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  645.         Debug-Output "Cannot find OdiLoad\"$(OdiModules)
  646.             goto fatalregistry
  647.         Endif
  648.     Endif
  649.     set CloseOdiModules = "1"
  650.         CreateRegKey $(KeyOdiModules) {$(CardInstanceName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyOdiCard
  651.     Endif
  652.  
  653.     Ifstr(i) $(KeyOdiCard) == $(KeyNull)
  654.         ;
  655.         ;  This is either an old card, or a prior version of the key existed.
  656.         ;
  657.     OpenRegKey $(KeyOdiLoad) "" $(OdiModules)\$(CardInstanceName) $(MAXIMUM_ALLOWED) KeyOdiCard
  658.     Ifstr(i) $(KeyOdiCard) == $(KeyNull)
  659.             set RegistryErrorIndex = CANNOT_FIND_COMPONEXT_SERVICE
  660.         Debug-Output "Can't create ODILOAD\"$(CardInstanceName)
  661.         goto fatalresistry
  662.     Endif
  663.     Endif
  664.  
  665.     set IOBaseAddressNw = *($(IOBaseAddrNwList), $(IOBaseAddress))
  666.  
  667.     Debug-Output "OEMNADXN.INF: IOBaseAddress = "$(IOBaseAddress)
  668.     Debug-Output "OEMNADXN.INF: IOBaseAddressNw = "$(IOBaseAdressNw)
  669.  
  670.     set OdiParmList = { "Port "$(IOBaseAddressNw),+
  671.                         "Frame TOKEN-RING",+
  672.             "Frame TOKEN-RING_SNAP" }
  673.  
  674.  
  675.  
  676.  
  677.     SetRegValue $(KeyOdiCard) {"Parameters",$(NoTitle),$(!REG_VT_MULTI_SZ),$(OdiParmList)}
  678.  
  679.     CloseRegKey $(KeyOdiLoad)
  680.     Ifstr(i) $(CloseOdiModules) != $(KeyNull)
  681.         CloseRegKey $(KeyOdiModules)
  682.     Endif
  683.     CloseRegKey $(KeyOdiCard)
  684.  
  685. ;
  686. ; Update the card name in IpxSpxII to be the last card installed
  687. ;
  688.     set IpxParameters = $(!NTN_ServiceBase)"\IpxSpxII\Parameters"
  689.     OpenRegKey $(!REG_H_LOCAL) "" $(IpxParameters) $(MAXIMUM_ALLOWED) KeyIpxParameters
  690.     Ifstr(i) $(KeyIpxParameters) == ""
  691.         Debug-Output "OEMNADNT.INF: Can't update IpxSpxII CardName"
  692.     Else
  693.         Split-String $(CardInstanceName) " " CardNameParts
  694.     set CardNameBase = *($(CardNameParts),1)
  695.         SetRegValue $(KeyIpxParameters) {"CardName",$(NoTitle),$(!REG_VT_SZ),$(CardNameBase)}
  696.     CloseRegKey $(KeyIpxParameters)
  697.     Endif
  698.  
  699.     goto successful
  700.  
  701. ;-----------------------------------------------
  702. ; Binding section
  703. ;-----------------------------------------------
  704. bindingadapter =+
  705.     set Error = "Binding: Sorry, not yet implemented."
  706.     goto fatal
  707.  
  708. ;-----------------------------------------------
  709. ; Removeadapter section
  710. ;-----------------------------------------------
  711.  
  712. removeadapter = +
  713. ;
  714. ;  TRAVIS: Put the ODILOAD adapter removal stuff here!
  715. ;
  716.  
  717. ;
  718. ; Delete the Services\OdiLoad\Odi_Modules\xxxxxx #01 card instance.
  719. ;
  720.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyParameters
  721.     Ifstr(i) $(KeyParameters) == ""
  722.  
  723.         Debug-Output "OEMNADNC.INF: removeadapter, Can't open "$(!NTN_RegBase)
  724.  
  725.     Else
  726.  
  727.         GetRegValue $(KeyParameters),"ServiceName", ServiceNameList
  728.         Set ServiceName = *($(ServiceNameList),4)
  729.         CloseRegKey $(KeyParameters)
  730.  
  731.  
  732.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyService
  733.     ifstr(i) $(KeyService) == ""
  734.  
  735.         Debug-Output "OEMNADNC.INF: removeadapter, Can't open "$(ServiceName)
  736.  
  737.     Else
  738.         GetRegValue $(KeyService),"OdiLoadName", CardInstanceList
  739.         Set CardInstanceName = *($(CardInstanceList),4)
  740.         CloseRegKey $(KeyService)
  741.  
  742.         Set OdiModuleName = $(!NTN_ServiceBase)"\"$(DriverName)"\"$(OdiModules)
  743.             OpenRegKey $(!REG_H_LOCAL) "" $(OdiModuleName) $(MAXIMUM_ALLOWED) KeyOdiModules
  744.             Ifstr(i) $(KeyOdiModules) == ""
  745.  
  746.                 Debug-Output "OEMNADNC.INF: removeadapter, Can't open "$(OdiModulesName)
  747.  
  748.             Else
  749.                 Debug-Output "OEMNADNC.INF: Deleting card "$(CardInstanceName)
  750.         Debug-Output "OEMNADNC.INF: From Key "$(OdiModuleName)
  751.  
  752.                 DeleteRegTree $(KeyOdiModules) $(CardInstanceName)
  753.  
  754.         FlushRegKey $(KeyOdiModules)
  755.         CloseRegKey $(KeyOdiModules)
  756.  
  757.             Endif
  758.     Endif
  759.  
  760.     Endif
  761.  
  762. ;
  763. ; Increment the OdiLoad reference count so OdiLoad is not removed as a
  764. ; service.
  765. ;
  766.  
  767.     Shell $(UtilityInf), IncrementRefCount, $(ProductKeyName)
  768.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  769.         Debug-Output "ShellCode error removeadapter"
  770.         goto ShellCodeError
  771.     Endif
  772.  
  773.     set RegistryErrorIndex = $($R0)
  774.  
  775.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  776.         goto fatalregistry
  777.     Endif
  778.  
  779.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  780.             $(DriverName), $(!NTN_RegBase)
  781.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  782.         Debug-Output "ShellCode error"
  783.         goto ShellCodeError
  784.     endif
  785.  
  786.     set RegistryErrorIndex = $($R0)
  787.  
  788.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  789.         goto fatalregistry
  790.     endif
  791.  
  792. ; Decrement the reference count so OdiLoad can be removed when all the
  793. ; ODI adapters have been removed.
  794. ;
  795.     Shell $(UtilityInf), DecrementRefCount, $(ProductKeyName)
  796.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  797.         Debug-Output "ShellCode error removeadapter"
  798.         goto ShellCodeError
  799.     Endif
  800.  
  801.     set RegistryErrorIndex = $($R0)
  802.  
  803.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  804.         goto fatalregistry
  805.     Endif
  806.  
  807.     goto end
  808.  
  809. ;-----------------------------------------------
  810. ; Upgrade Software section
  811. ;-----------------------------------------------
  812.  
  813. UpgradeSoftware = +
  814.     ;
  815.     ; upgrade/update hardware component
  816.     ; There is no different between upgrade and update for hardware
  817.     ; component
  818.     ;
  819.     ; 1. Get the Service Name
  820.     ; 2. Change the NetRule section if necessary
  821.     ;
  822.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  823.           $(MAXIMUM_ALLOWED) NetworkCardKey
  824.     Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  825.         ;
  826.         ; Get Service name
  827.         ;
  828.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  829.         set ServiceName = *($(ServiceNameInfo), 4)
  830.  
  831.         ;
  832.         ; Change the NetRule if necessary
  833.         ;
  834.         OpenRegKey $(NetworkCardKey) "" "NetRules" +
  835.             $(MAXIMUM_ALLOWED) NetRuleKey
  836.         Ifstr(i) $(NetRuleKey) != $(KeyNull)
  837.             ;
  838.             ; Make the change....
  839.             ;
  840.         else
  841.             ;
  842.             ; Error, cannot open net rules key
  843.             ;
  844.             goto fatalregistry
  845.         endif
  846.  
  847.         CloseRegKey $(NetRules)
  848.         CloseRegKey $(NetworkCardKey)
  849.     else
  850.         ;
  851.         ; Error, cannot open network card key
  852.         ;
  853.         goto fatalregistry
  854.     endif
  855.     ;
  856.     ; 3. Change the service section of the hardware. i.e.,
  857.     ;    ParameterName change, value change, etc.
  858.     ;
  859.     OpenRegKey $(!REG_H_LOCAL) "" +
  860.           $(!NTN_ServiceBase)"\"$(ServiceName) +
  861.           $(MAXIMUM_ALLOWED) ServiceKey
  862.  
  863.     Ifstr(i) $(ServiceKey) != $(KeyNull)
  864.         ;
  865.         ; Get the ServiceKey to change the Start value
  866.         ; or Type value. Or open Parameters key to
  867.         ; change the hardware parameters if necessary.
  868.         ;
  869.         CloseRegKey $(ServiceKey)
  870.     else
  871.         ;
  872.         ; Error, cannot open network card key
  873.         ;
  874.         goto fatalregistry
  875.     endif
  876.  
  877.     goto end
  878.     ;
  879.     ; End of Upgrade Software
  880.     ;
  881.  
  882. ;
  883. ;  Escape hatches
  884. ;
  885. successful = +
  886.     goto end
  887.  
  888. abandon = +
  889.     ForListDo $(OEM_ABANDON_OPTIONS)
  890.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  891.             $(DriverName), $($)
  892.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  893.             Debug-Output "ShellCode error"
  894.             goto ShellCodeError
  895.         endif
  896.  
  897.         set RegistryErrorIndex = $($R0)
  898.  
  899.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  900.             goto fatalregistry
  901.         endif
  902.     EndForListDo
  903.  
  904.     goto end
  905.  
  906. ;
  907. ; warning display
  908. ;
  909. warning = +
  910.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  911.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  912.         goto ShellCodeError
  913.     endif
  914.     ifstr(i) $($R1) == "OK"
  915.         goto $(to)
  916.     else-ifstr(i) $($R1) == "CANCEL"
  917.         goto $(from)
  918.     else
  919.         goto "end"
  920.     endif
  921.  
  922.  
  923. ;
  924. ; non fatal error display
  925. ;
  926. nonfatalinfo = +
  927.     Set CommonStatus = STATUS_USERCANCEL
  928.     Set Severity = STATUS
  929.     goto nonfatalmsg
  930. nonfatal = +
  931.     Set Severity = NONFATAL
  932.     goto nonfatalmsg
  933. nonfatalmsg = +
  934.     ifstr(i) $(Error) == ""
  935.         Set Severity = NONFATAL
  936.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  937.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  938.             goto ShellCodeError
  939.         endif
  940.         set Error = $($R0)
  941.     endif
  942.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  943.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  944.         goto ShellCodeError
  945.     endif
  946.     ifstr(i) $($R1) == "OK"
  947.         goto $(from)
  948.     else
  949.         goto "end"
  950.     endif
  951.  
  952. ;
  953. ;  Registry is broken
  954. ;
  955. fatalregistry = +
  956.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  957.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  958.         goto ShellCodeError
  959.     endif
  960.     set Error = $($R0)
  961.     goto fatal
  962.  
  963. fataldetect = +
  964.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  965.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  966.         Debug-Output "ShellCode error: cannot get an error string."
  967.         goto ShellCodeError
  968.     endif
  969.     set Error = $($R0)
  970.     Goto fatal
  971. ;
  972. ; fatal error display
  973. ;
  974. fatal = +
  975.     ifstr(i) $(Error) == ""
  976.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  977.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  978.             goto ShellCodeError
  979.         endif
  980.         set Error = $($R0)
  981.     endif
  982.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  983.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  984.         goto ShellCodeError
  985.     endif
  986.  
  987.     goto setfailed
  988.  
  989. ;
  990. ;  Shelling error
  991. ;
  992. ShellCodeError = +
  993.     set DlgType      = "MessageBox"
  994.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  995.     set STF_MB_TEXT  = "Shell Code Error"
  996.     set STF_MB_TYPE  = 1
  997.     set STF_MB_ICON  = 3
  998.     set STF_MB_DEF   = 1
  999.     ui start "Error Message"
  1000.     goto setfailed
  1001.  
  1002. setfailed = +
  1003.     set CommonStatus = STATUS_FAILED
  1004.     ;
  1005.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1006.     ;
  1007.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1008.         set OEM_ABANDON_ON = FALSE
  1009.         goto abandon
  1010.     endif
  1011.     goto end
  1012.  
  1013. end = +
  1014.     goto term
  1015.  
  1016. term = +
  1017.  
  1018.     Return $(CommonStatus)
  1019.  
  1020. ;***************************************************************
  1021. ;  INSTALL SECTIONS
  1022. ;***************************************************************
  1023. [Install-Option]
  1024.     set STF_VITAL = ""
  1025.  
  1026.     ifstr(i) $(AddCopy) == "YES"
  1027.  
  1028.         ;
  1029.         ; Add the files to the copy list
  1030.         ;
  1031.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1032.  
  1033.     endif
  1034.  
  1035.     ifstr(i) $(DoCopy) == "YES"
  1036.  
  1037.        ;
  1038.        ; Copy files in the copy list
  1039.        ;
  1040.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1041.        CopyFilesInCopyList
  1042.  
  1043.     endif
  1044.  
  1045.     ifstr(i) $(DoConfig) == "YES"
  1046.         ;
  1047.         ; Add product to registry
  1048.         ;
  1049.  
  1050.         ;
  1051.         ; Finish up
  1052.     endif
  1053.  
  1054.     Exit
  1055.  
  1056. [Install-Update]
  1057.    set STF_VITAL        = ""
  1058.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1059.    ;set STF_VERSION     = "YES"
  1060.  
  1061.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1062.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1063.  
  1064.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1065.    CopyFilesInCopyList
  1066.  
  1067.    exit
  1068.  
  1069. [Source Media Descriptions]
  1070.     1  = "Windows NT Setup Disk #1"  , TAGFILE = disk1
  1071.     2  = "Windows NT Setup CD-ROM Disk"  , TAGFILE = disk2
  1072.     99    = "LMHOST disk", TAGFILE = lmhosts
  1073. [ProductType]
  1074. STF_PRODUCT  = Winnt
  1075. STF_PLATFORM = I386
  1076. [Files-Inf]
  1077. 2, oemnadnt.inf,    SIZE=1000
  1078. [Files-IBMTok]
  1079. 2, token.lan.sys,   SIZE=54784
  1080.  
  1081.  
  1082.  
  1083.